<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>v_hdmitxss: xhdmi_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.gif"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">v_hdmitxss
   </div>
   <div id="projectbrief">Xilinx SDK Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xhdmi__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#define-members">Macros</a> &#124;
<a href="#func-members">Functions</a> &#124;
<a href="#var-members">Variables</a>  </div>
  <div class="headertitle">
<div class="title">xhdmi_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file demonstrates how to use Xilinx HDMI TX Subsystem, HDMI RX Subsystem and Video PHY Controller drivers. </p>
<pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who    Date     Changes
<hr/>

1.00         25/11/15 Initial release.
1.10         05/02/16 Updated function RxAuxCallback.
2.00  MG     02/03/15 Added upgraded with HDCP driver and overlay
2.10  MH     06/23/16 Added HDCP repeater support.
2.11  YH     04/08/16 Added two level validation routines
                      Basic_validation will only check the received VmId
                      PRBS_validation will check both video &amp; audio contents
2.12  YH     03/01/16 Fixed a system hang issue by clearing TxBusy flag when a
                           non-supportedvideo resolution is set
                           during enable colorbar API
2.13  GM     23/01/17 Replace the Extraction Value of VPhy line rate with,
                           XVphy_GetLineRateHz Rate API return value.
                      Removed CPU Clock Frequence on XVphy_HdmiInitialize
                           Initialization.
</pre><pre>
MODIFICATION HISTORY:</pre><pre>Ver   Who    Date     Changes
<hr/>

1.00         25/11/15 Initial release.
1.10         05/02/16 Updated function RxAuxCallback.
2.00  MG     02/03/15 Added upgraded with HDCP driver and overlay
2.10  MH     06/23/16 Added HDCP repeater support.
2.11  YH     04/08/16 Added two level validation routines
                      Basic_validation will only check the received VmId
                      PRBS_validation will check both video &amp; audio contents
2.12  GM     07/10/16 Added onboard SI5324 Initialization API to enable
                      125Mhz as NI-DRU reference clock
2.13  YH     03/01/16 Fixed a system hang issue by clearing TxBusy flag when a
                           non-supportedvideo resolution is set
                           during enable colorbar API
2.14  GM     23/01/17 Replace the Extraction Value of VPhy line rate with,
                           XVphy_GetLineRateHz Rate API return value.
                      Removed CPU Clock Frequence on XVphy_HdmiInitialize
                           Initialization.
</pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:a9e3c02ccaf71eeda39e2524f2fb02a41"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xhdmi__example_8c.html#a9e3c02ccaf71eeda39e2524f2fb02a41">I2C_MUX_ADDR</a>&#160;&#160;&#160;0x74</td></tr>
<tr class="memdesc:a9e3c02ccaf71eeda39e2524f2fb02a41"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C Mux Address.  <a href="#a9e3c02ccaf71eeda39e2524f2fb02a41">More...</a><br /></td></tr>
<tr class="separator:a9e3c02ccaf71eeda39e2524f2fb02a41"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a71bd0b63917e21a117972939353bda39"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xhdmi__example_8c.html#a71bd0b63917e21a117972939353bda39">I2C_CLK_ADDR</a>&#160;&#160;&#160;0x68</td></tr>
<tr class="memdesc:a71bd0b63917e21a117972939353bda39"><td class="mdescLeft">&#160;</td><td class="mdescRight">I2C Clk Address.  <a href="#a71bd0b63917e21a117972939353bda39">More...</a><br /></td></tr>
<tr class="separator:a71bd0b63917e21a117972939353bda39"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:adcbba64f9438ee7f171f2718c6324474"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xhdmi__example_8c.html#adcbba64f9438ee7f171f2718c6324474">I2cMux</a> (void)</td></tr>
<tr class="memdesc:adcbba64f9438ee7f171f2718c6324474"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function setup SI5324 clock generator over IIC.  <a href="#adcbba64f9438ee7f171f2718c6324474">More...</a><br /></td></tr>
<tr class="separator:adcbba64f9438ee7f171f2718c6324474"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a13f636ef2d93d7ee10e421e5f604a510"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xhdmi__example_8c.html#a13f636ef2d93d7ee10e421e5f604a510">I2cClk</a> (u32 InFreq, u32 OutFreq)</td></tr>
<tr class="memdesc:a13f636ef2d93d7ee10e421e5f604a510"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function setup SI5324 clock generator either in free or locked mode.  <a href="#a13f636ef2d93d7ee10e421e5f604a510">More...</a><br /></td></tr>
<tr class="separator:a13f636ef2d93d7ee10e421e5f604a510"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14b96491d9e48ad8fadbbb391d097ab6"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xhdmi__example_8c.html#a14b96491d9e48ad8fadbbb391d097ab6">Info</a> (void)</td></tr>
<tr class="memdesc:a14b96491d9e48ad8fadbbb391d097ab6"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function outputs the video timing , Audio, Link Status, HDMI RX state of HDMI RX core.  <a href="#a14b96491d9e48ad8fadbbb391d097ab6">More...</a><br /></td></tr>
<tr class="separator:a14b96491d9e48ad8fadbbb391d097ab6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab458f6ff7df970c30ccf4a575995bc7e"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xhdmi__example_8c.html#ab458f6ff7df970c30ccf4a575995bc7e">SetupInterruptSystem</a> (void)</td></tr>
<tr class="memdesc:ab458f6ff7df970c30ccf4a575995bc7e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function setups the interrupt system so interrupts can occur for the HDMI cores.  <a href="#ab458f6ff7df970c30ccf4a575995bc7e">More...</a><br /></td></tr>
<tr class="separator:ab458f6ff7df970c30ccf4a575995bc7e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xhdmi__example_8c.html#ae66f6b31b5ad750f1fe042a706a4e3d4">main</a> ()</td></tr>
<tr class="memdesc:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function to call example with HDMI TX, HDMI RX and HDMI GT drivers.  <a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">More...</a><br /></td></tr>
<tr class="separator:ae66f6b31b5ad750f1fe042a706a4e3d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
Variables</h2></td></tr>
<tr class="memitem:a2d5525edd4cf0958da26f4eb70d24b85"><td class="memItemLeft" align="right" valign="top">u8&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xhdmi__example_8c.html#a2d5525edd4cf0958da26f4eb70d24b85">IsPassThrough</a></td></tr>
<tr class="memdesc:a2d5525edd4cf0958da26f4eb70d24b85"><td class="mdescLeft">&#160;</td><td class="mdescRight">Demo mode 0-colorbar 1-pass through.  <a href="#a2d5525edd4cf0958da26f4eb70d24b85">More...</a><br /></td></tr>
<tr class="separator:a2d5525edd4cf0958da26f4eb70d24b85"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="a71bd0b63917e21a117972939353bda39"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a71bd0b63917e21a117972939353bda39">&#9670;&nbsp;</a></span>I2C_CLK_ADDR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define I2C_CLK_ADDR&#160;&#160;&#160;0x68</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>I2C Clk Address. </p>

<p class="reference">Referenced by <a class="el" href="xhdmi__example_8c.html#a13f636ef2d93d7ee10e421e5f604a510">I2cClk()</a>.</p>

</div>
</div>
<a id="a9e3c02ccaf71eeda39e2524f2fb02a41"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e3c02ccaf71eeda39e2524f2fb02a41">&#9670;&nbsp;</a></span>I2C_MUX_ADDR</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">#define I2C_MUX_ADDR&#160;&#160;&#160;0x74</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>I2C Mux Address. </p>

<p class="reference">Referenced by <a class="el" href="xhdmi__example_8c.html#adcbba64f9438ee7f171f2718c6324474">I2cMux()</a>.</p>

</div>
</div>
<h2 class="groupheader">Function Documentation</h2>
<a id="a13f636ef2d93d7ee10e421e5f604a510"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a13f636ef2d93d7ee10e421e5f604a510">&#9670;&nbsp;</a></span>I2cClk()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int I2cClk </td>
          <td>(</td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>InFreq</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>OutFreq</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function setup SI5324 clock generator either in free or locked mode. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">Index</td><td>specifies an index for selecting mode frequency. </td></tr>
    <tr><td class="paramname">Mode</td><td>specifies either free or locked mode.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>Zero if error in programming external clock.</li>
<li>One if programmed external clock.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xhdmi__example_8c.html#a71bd0b63917e21a117972939353bda39">I2C_CLK_ADDR</a>, <a class="el" href="xhdmi__example_8c.html#a2d5525edd4cf0958da26f4eb70d24b85">IsPassThrough</a>, <a class="el" href="si5324drv_8h.html#a2db6980ae01d5ddad9a49d3251516feb">SI5324_CLKSRC_CLK1</a>, <a class="el" href="si5324drv_8h.html#aa1d51e9b1e4b660eee4ec41222751c1e">SI5324_CLKSRC_XTAL</a>, <a class="el" href="si5324drv_8c.html#a5fe598dcb0d500c012afc7970117f5ed">Si5324_SetClock()</a>, <a class="el" href="si5324drv_8h.html#ab111a2a2d52eb8e3366d8c5723a186a8">SI5324_SUCCESS</a>, <a class="el" href="si5324drv_8h.html#aba0c6a06cbada8a7b750be6ff0695a47">SI5324_XTAL_FREQ</a>, and <a class="el" href="xv__hdmitxss_8c.html#ae0188b2e6efd4b22b2c0c8203a180f52">XV_HdmiTxSs_GetVideoStream()</a>.</p>

</div>
</div>
<a id="adcbba64f9438ee7f171f2718c6324474"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adcbba64f9438ee7f171f2718c6324474">&#9670;&nbsp;</a></span>I2cMux()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int I2cMux </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function setup SI5324 clock generator over IIC. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The number of bytes sent.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p class="reference">References <a class="el" href="xhdmi__example_8c.html#a9e3c02ccaf71eeda39e2524f2fb02a41">I2C_MUX_ADDR</a>.</p>

</div>
</div>
<a id="a14b96491d9e48ad8fadbbb391d097ab6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14b96491d9e48ad8fadbbb391d097ab6">&#9670;&nbsp;</a></span>Info()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Info </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function outputs the video timing , Audio, Link Status, HDMI RX state of HDMI RX core. </p>
<p>In addition, it also prints information about HDMI TX, and HDMI GT cores.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None.</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="ae66f6b31b5ad750f1fe042a706a4e3d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae66f6b31b5ad750f1fe042a706a4e3d4">&#9670;&nbsp;</a></span>main()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function to call example with HDMI TX, HDMI RX and HDMI GT drivers. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if HDMI example was successfully.</li>
<li>XST_FAILURE if HDMI example failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

</div>
</div>
<a id="ab458f6ff7df970c30ccf4a575995bc7e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab458f6ff7df970c30ccf4a575995bc7e">&#9670;&nbsp;</a></span>SetupInterruptSystem()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int SetupInterruptSystem </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function setups the interrupt system so interrupts can occur for the HDMI cores. </p>
<p>The function is application-specific since the actual system may or may not have an interrupt controller. The HDMI cores could be directly connected to a processor without an interrupt controller. The user should modify this function to fit the application.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if interrupt setup was successful.</li>
<li>A specific error code defined in "xstatus.h" if an error occurs.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function assumes a Microblaze system and no operating system is used. </dd></dl>

</div>
</div>
<h2 class="groupheader">Variable Documentation</h2>
<a id="a2d5525edd4cf0958da26f4eb70d24b85"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2d5525edd4cf0958da26f4eb70d24b85">&#9670;&nbsp;</a></span>IsPassThrough</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">u8 IsPassThrough</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Demo mode 0-colorbar 1-pass through. </p>

<p class="reference">Referenced by <a class="el" href="xhdmi__example_8c.html#a13f636ef2d93d7ee10e421e5f604a510">I2cClk()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Copyright &copy; 2015 Xilinx Inc. All rights reserved.</li>
  </ul>
</div>
</body>
</html>
